home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 3.1 (Developer) [x86]
/
NeXT Step 3.1 Intel dev.cdr.dmg
/
NextDeveloper
/
Examples
/
AppKit
/
Draw
/
graphicsUndo.subproj
/
DeleteGraphicsChange.m
< prev
next >
Wrap
Text File
|
1992-02-09
|
2KB
|
79 lines
#import "drawundo.h"
@interface DeleteGraphicsChange(PrivateMethods)
- undoDetails;
- redoDetails;
@end
@implementation DeleteGraphicsChange
- free
{
if ([self hasBeenDone])
[graphics freeObjects];
return [super free];
}
- (const char *)changeName
{
return DELETE_OPERATION;
}
- saveBeforeChange
{
[super saveBeforeChange];
[changeDetails makeObjectsPerform:@selector(recordGraphicPositionIn:) with:[graphicView graphics]];
return self;
}
- undoDetails
{
int count, i;
id detail, graphic;
List *allGraphics;
count = [changeDetails count];
allGraphics = [graphicView graphics];
for (i = 0; i < count; i++) {
detail = [changeDetails objectAt:i];
graphic = [detail graphic];
[allGraphics insertObject:graphic at:[detail graphicPosition]];
[graphic wasAddedTo:graphicView];
}
[graphicView getSelection];
return self;
}
- redoDetails
{
int count, i;
id detail, graphic;
List *selectedGraphics;
List *allGraphics;
selectedGraphics = [graphicView selectedGraphics];
allGraphics = [graphicView graphics];
count = [changeDetails count];
for (i = 0; i < count; i++) {
detail = [changeDetails objectAt:i];
graphic = [detail graphic];
[selectedGraphics removeObject:graphic];
[allGraphics removeObject:graphic];
[graphic wasRemovedFrom:graphicView];
}
[graphicView resetGroupInSlist];
return self;
}
- changeDetailClass
{
return [OrderChangeDetail class];
}
@end